package casa.depesos.app.com.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import casa.depesos.app.com.App;
import casa.depesos.app.com.R;
import casa.depesos.app.com.frag.OrderFragment;


public class OrderAdapter extends FragmentPagerAdapter {

    String[] title = App.getApp().getResources().getStringArray(R.array.orders);
    String[] status = App.getApp().getResources().getStringArray(R.array.orders_status);

    public OrderAdapter(@NonNull FragmentManager fm) {
        super(fm);
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return new OrderFragment().setStatus(status[position]);
    }

    @Override
    public int getCount() {
        return 4;
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return title[position];
    }
}
